<md-card>
    <table ng-if="settings" class="table">
        <tr>
            <th colspan="2">Target Topology</th>
            <th width="10%">
                <span style="display:inline-block;;margin: 2px;" ng-click="saveTopoTarget(selectedTopoTarget)">
                    <i style="display:inline-block;;margin: 2px;" class="fa fa-save"></i>
                </span>
            </th>
        </tr>
        <tr>
            <td colspan="3">
                <span style="display:inline-block;;margin: 2px;"
                    class="label label-success">{{selectedCluster.config.topologyTarget }}</span>
                <md-select name="selectedTopoTarget" ng-model="selectedTopoTarget">
                    <md-option ng-selected="{{key ==  selectedCluster.config.topologyTarget}}"
                        ng-repeat="(key, value) in selectedCluster.topologyType" ng-value="key">{{key}}</md-option>
                </md-select>
            </td>
        </tr>
    </table>
    <table ng-if="settings" class="table">
        <tr>
            <th>Allow multi-master-ring topology on unsafe cluster</th>
        </tr>
        <tr>
            <td>
                <md-switch ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false"
                    ng-true-value="true" ng-false-value="false"
                    ng-model="selectedCluster.config.replicationMultiMasterRingUnsafe"
                    ng-click="switchsettings('multi-master-ring-unsafe')"
                    aria-label="Allow multi-master-ring topology on unsafe cluster with no log slave updates">
                    <span ng-if="selectedCluster.config.replicationMultiMasterRingUnsafe"
                        class="label label-primary">On</span>
                    <span ng-if="!selectedCluster.config.replicationMultiMasterRingUnsafe"
                        class="label label-warning">Off</span>
                </md-switch>
            </td>
        </tr>
        <tr>
            <th>Allow Multi-Tier Slave</th>
        </tr>
        <tr>
            <td>
                <md-switch
                    ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false"
                    ng-true-value="false" ng-false-value="true"
                    ng-model="selectedCluster.config.replicationMasterSlaveNeverRelay"
                    ng-click="switchsettings('replication-no-relay')" aria-label="Allow multi-tier slave by disabling replication no relay">
                    <span ng-if="!selectedCluster.config.replicationMasterSlaveNeverRelay" class="label label-primary">On</span>
                    <span ng-if="selectedCluster.config.replicationMasterSlaveNeverRelay"
                        class="label label-warning">Off</span>
                </md-switch>
            </td>
        </tr>
    </table>
</md-card>